const projects = [
    {
        startDate: '2018-04',
        endDate: '至今',
        title: '重大工程项目',
        research: '核电标准体系研究',
        role: '技术负责人',
        status: '在执行'
    },
    {
        startDate: '2018-04',
        endDate: '2018-04',
        title: '关键核心技术攻关项目',
        research: '核电标准体系研究',
        role: '技术负责人',
        status: '已结束'
    },
    {
        startDate: '2018-04',
        endDate: '2018-04',
        title: '关键核心技术攻关项目',
        research: '核电标准体系研究',
        role: '技术负责人',
        status: '已结束'
    },
    {
        startDate: '2018-04',
        endDate: '2018-04',
        title: '关键核心技术攻关项目',
        research: '核电标准体系研究',
        role: '技术负责人',
        status: '已结束'
    }
];

const projectList = document.getElementById('project-list');

projects.forEach(project => {
    const projectItem = document.createElement('div');
    projectItem.className = 'project-item';
    const projectHeader = document.createElement('div');
    projectHeader.className = 'project-header';
    projectHeader.innerHTML = `
        <span>${project.startDate} - ${project.endDate}</span> 
        <span class="project-title">${project.title}</span>
        <span class="project-status ${project.status === '已结束' ? 'completed' : ''}">${project.status}</span>
    `;

    const projectContent = document.createElement('div');
    projectContent.className = 'project-content';
    projectContent.innerHTML = `
        <span>${project.research}</span>
        <span>${project.role}</span>
    `;

    projectItem.appendChild(projectHeader);
    projectItem.appendChild(projectContent);
    projectList.appendChild(projectItem);
});